import { version as wranglerVersion } from "../../package.json";

const isWindows = process.platform === "win32";

export const MAX_ASSET_COUNT = 20_000;
export const MAX_ASSET_SIZE = 25 * 1024 * 1024;
export const PAGES_CONFIG_CACHE_FILENAME = "pages.json";
export const MAX_BUCKET_SIZE = 40 * 1024 * 1024;
// Reduce the maximum number of files in a bucket on Windows
// This helps to avoid EMFILE errors when reading them into memory.
export const MAX_BUCKET_FILE_COUNT = isWindows ? 1000 : 2000;
export const BULK_UPLOAD_CONCURRENCY = 3;
export const MAX_UPLOAD_ATTEMPTS = 5;
export const MAX_UPLOAD_GATEWAY_ERRORS = 5;
export const MAX_DEPLOYMENT_ATTEMPTS = 3;
export const MAX_DEPLOYMENT_STATUS_ATTEMPTS = 5;
export const MAX_CHECK_MISSING_ATTEMPTS = 5;
export const SECONDS_TO_WAIT_FOR_PROXY = 5;
/** Max number of rules in _routes.json */
export const MAX_FUNCTIONS_ROUTES_RULES = 100;
/** Max char length of each rule in _routes.json */
export const MAX_FUNCTIONS_ROUTES_RULE_LENGTH = 100;
export const ROUTES_SPEC_VERSION = 1;
export const ROUTES_SPEC_DESCRIPTION = `Generated by wrangler@${wranglerVersion}`;
